package com.hz.foodstalls.util;

import com.hz.yunpian.model.SendBatchInfo;
import com.hz.yunpian.service.SmsOperator;
import com.hz.yunpian.service.YunpianClient;
import com.jfinal.kit.PropKit;

public class SmsUtil {

    public static SendBatchInfo smsSend(String mobile, String text) {
        // 初始化一个基于云片网apikey的Client
        YunpianClient client = new YunpianClient(PropKit.get("smskey")); // a8037698c29b2d790c40134797bf4f85
        // 通过client创建一个短信操作类
        SmsOperator smsoperator = client.getSmsOperator();
        // 群发短信
        SendBatchInfo batchinfo = smsoperator.sendBatchMessage(mobile, text);

        return batchinfo;
    }
}
